*Use Kemahlioglu&Sayari PUCH 2017 replication choice_data

*Table 2
cd C:\data
clogit choice altsamepartygroup3 altdifincumbent altdifpartysizeest g1invmillsind g3invmillsind g6invmillsind g7invmillsind g8invmillsind g9invmillsind g10invmillsind g11invmillsind g12invmillsind g13invmillsind g14invmillsind g15invmillsind g17invmillsind g18invmillsind g19invmillsind g20invmillsind g21invmillsind g22invmillsind g23invmillsind g24invmillsind g1 g3 g6 g7 g8 g9 g10 g11 g12 g13 g14 g15 g17 g18 g19 g20 g21 g22 g23 g24 if switchindv2==1 & g4!=1, robust group(case3)
outreg2 using tablerev, bdec(3) excel replace label
clogit choice altsamepartygroup3 altdifincumbent altdifpartysizeest g1invmillsfac g3invmillsfac g6invmillsfac g7invmillsfac g8invmillsfac g9invmillsfac g10invmillsfac g11invmillsfac g12invmillsfac g13invmillsfac g15invmillsfac g16invmillsfac g17invmillsfac g18invmillsfac g19invmillsfac g21invmillsfac  g24invmillsfac g1 g3 g6 g7 g8 g9 g10 g11 g12 g13 g15 g16 g17 g18 g19 g21 g24 if faction5==1 & g4!=1, robust group(case3)
outreg2 using tablerev, bdec(3) excel append label

*Online Appendix
*Descriptive statistics (party level)
sum choice altsamepartygroup3 altdifincumbent altdifpartysizeest  if faction5==1 & g25!=1 & g4!=1 & altsamepartygroup3~=. &  invmillsfac!=. & case3~=18725 &  case3~=36054 &  case3~=37417 & case3~=32944 & case3~=43563 & case3~=62295
sum choice altsamepartygroup3 altdifincumbent altdifpartysizeest  if switchindv2==1 & g25!=1 & g4!=1 & altsamepartygroup3~=. & invmillsind!=. 

*Descriptive statistics (Party indicators and inverse mills ratios)
sum g1invmillsfac g3invmillsfac g6invmillsfac g7invmillsfac g8invmillsfac g9invmillsfac g10invmillsfac g11invmillsfac g12invmillsfac g13invmillsfac g14invmillsfac g15invmillsfac g16invmillsfac g17invmillsfac g18invmillsfac g19invmillsfac g21invmillsfac g23invmillsfac g24invmillsfac g1 g3 g6 g7 g8  g9 g10 g11 g12 g13 g14 g15  g16 g17 g18 g19 g21 g23 g24 if faction5==1 & g25!=1 & g4!=1 & altsamepartygroup3~=. &  invmillsfac!=. & case3~=18725 &  case3~=36054 &  case3~=37417 & case3~=32944 & case3~=43563 & case3~=62295
sum g1invmillsind g3invmillsind g6invmillsind g7invmillsind g8invmillsind g9invmillsind g10invmillsind g11invmillsind g12invmillsind g13invmillsind g14invmillsind g15invmillsind g17invmillsind g18invmillsind g19invmillsind g20invmillsind g21invmillsind g22invmillsind g23invmillsind g24invmillsind g25invmillsind g1 g3 g5 g6 g7 g8 g9 g10 g11 g12 g13 g14 g15 g16 g17 g18 g19 g20 g21 g22 g23 g24 g25 if switchindv2==1 & g25!=1 & g4!=1 & altsamepartygroup3~=. & invmillsind!=.
